<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title><?php echo empty($title)?"":$title; ?></title>
    <!-- Fontfaces CSS-->
    <link href="/static/admin/theme/css/font-face.css" rel="stylesheet" media="all">
    <link href="/static/admin/theme/vendor/font-awesome-4.7/css/font-awesome.min.css" rel="stylesheet" media="all">
    <link href="/static/admin/theme/vendor/font-awesome-5/css/fontawesome-all.min.css" rel="stylesheet" media="all">
    <link href="/static/admin/theme/vendor/mdi-font/css/material-design-iconic-font.min.css" rel="stylesheet"
          media="all">

    <!-- Bootstrap CSS-->
    <link href="/static/admin/theme/vendor/bootstrap-4.1/bootstrap.min.css" rel="stylesheet" media="all">

    <!-- Vendor CSS-->
    <link href="/static/admin/theme/vendor/animsition/animsition.min.css" rel="stylesheet" media="all">
    <link href="/static/admin/theme/vendor/bootstrap-progressbar/bootstrap-progressbar-3.3.4.min.css" rel="stylesheet"
          media="all">
    <link href="/static/admin/theme/vendor/wow/animate.css" rel="stylesheet" media="all">
    <link href="/static/admin/theme/vendor/css-hamburgers/hamburgers.min.css" rel="stylesheet" media="all">
    <link href="/static/admin/theme/vendor/slick/slick.css" rel="stylesheet" media="all">
    <link href="/static/admin/theme/vendor/select2/select2.min.css" rel="stylesheet" media="all">
    <link href="/static/admin/theme/vendor/perfect-scrollbar/perfect-scrollbar.css" rel="stylesheet" media="all">
    <link href="/static/admin/theme/vendor/vector-map/jqvmap.min.css" rel="stylesheet" media="all">

    <!-- Main CSS-->
    <link href="/static/admin/theme/css/theme.css" rel="stylesheet" media="all">
    <link href="/static/admin/theme/css/customize.css" rel="stylesheet">

    <!-- Jquery JS-->
    <script src="/static/admin/theme/vendor/jquery-3.2.1.min.js"></script>
</head>
<body>
<div class="page-wrapper">
    <div class="page-content--bge5">
        <div class="container">
            <div class="login-wrap">
                <div class="login-content">
                    <div class="login-logo">
                        <a href="#">
                            <img src="/static/admin/theme/images/icon/logo-blue.png" alt="无锡蓝科创想科技有限公司">
                        </a>
                    </div>
                    <div class="login-form">
                        <form role="form" id="form" name="form" method="post"
                              data-bv-feedbackicons-valid="glyphicon glyphicon-ok"
                              data-bv-feedbackicons-invalid="glyphicon glyphicon-remove"
                              data-bv-feedbackicons-validating="glyphicon glyphicon-refresh">
                            <div class="form-group">
                                <div class="form-group">
                                    <label>用户名</label>
                                    <input type="text" name="loginname" class="form-control span12" value="administrator" data-bv-notempty="true"
                                           data-bv-notempty-message="用户名不能为空！" >
                                </div>
                            </div>
                            <div class="form-group">
                                <label>密&nbsp;&nbsp;码</label>
                                <input type="password" name="loginpass" class="span12 form-control" value="123456" data-bv-notempty="true"
                                       data-bv-notempty-message="密码不能为空！" >
                            </div>
<!--                            <div class="login-checkbox">-->
<!--                                <label>-->
<!--                                    <input type="checkbox" name="remember">记住我-->
<!--                                </label>-->
<!--                            </div>-->
                            <button class="au-btn au-btn--block au-btn--green m-b-20" type="button" onclick="login()">登入</button>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="/static/admin/lib/bootstrap/js/bootstrap.js"></script>
<script src="/static/admin/lib/bootstrapvalidator/js/bootstrapValidator.min.js" type="text/javascript"></script>
<script src="/static/admin/lib/jquery.form.min.js" type="text/javascript"></script>
<script src="/static/admin/lib/bootstrap-growl/jquery.bootstrap-growl.js"></script>
<script src="/static/admin/lib/global.js" type="text/javascript"></script>
<script>
    $(function () {
        $('#form').bootstrapValidator();
    });
    function login() {
        $('#form').data('bootstrapValidator').validate();
        var valid = $('#form').data('bootstrapValidator').isValid();
        if (valid) {
            $.post('index.php?r=admin/default/login',{
                'loginname':$("input[name=loginname]").val(),
                'loginpass':$("input[name=loginpass]").val(),
                "YII_CSRF_TOKEN":'<?php echo Yii::app()->request->csrfToken; ?>'
            },function(result){
                $("#captchimage").trigger("click");
                if(result.type == true){
                    window.location.href="index.php?r=admin/console/index";
                }else{
                    alert(result.message);
                }
            },'json');
        }
    }
</script>
</body>
</html>